<template>
  <div >
    <iframe
      ref="iframeRef"
      :src="iframeSrc"
      class="iframe-content"
      @load="onIframeLoad"
    ></iframe>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue';

const iframeRef = ref(null);
const iframeSrc = '../../public/ScholarOne Manuscripts.html';

const onIframeLoad = () => {
  try {
    const iframe = iframeRef.value;
    iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 'px';
  } catch (e) {
    console.error('无法获取 iframe 内容高度:', e);
  }
};

onMounted(() => {
  if (iframeRef.value) {
    onIframeLoad();
  }
});
</script>

<style lang="scss" scoped>
.iframe-container {
  // width: 100%;
  // height: 100%;
  // overflow: auto; // 处理内容溢出情况
}

.iframe-content {
  width: 100%;
  border: none;
  min-height: 100vh; // 最小高度为视口高度
}
.iframe-content::-webkit-scrollbar {
  display: none !important;  /* 隐藏滚动条 */
}
.iframe-container::-webkit-scrollbar {
  display: none;  /* 隐藏滚动条 */
}
</style>    